<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /* number,string,boolean */
        /* 1.string,boolean  -->number
        Number()  --强制转换
         */
         var a="12";
         var num=Number(a);
         var str="12px"
         console.log(typeof num)
         console.log(num)
         console.log(a)
         console.log(Number(str))  //NaN(not a Number) 不是一个数字
    </script>
</body>
</html>